/*
 * @Author: 胡海
 * @Date: 2020-04-21 16:55:33
 * @LastEditors: 胡海
 * @LastEditTime: 2020-04-21 18:19:09
 * @Description: 
 */
//index.js
//获取应用实例
const app = getApp()
import {
  data
} from '../../utils/data'

Page({
  data: {
    parameter: {
      'navbar': '0',
      'return': '0'
    },
    swiperConfig1: {
      circular: true,
      autoplay: true,
      interval: 3000,
      duration: 500,
    },
    swiperConfig2: {
      indicatorDots:false,
      circular: true,
      autoplay: true,
      interval: 2500,
      duration: 500,
    }
  },
  //事件处理函数
  // 首页数据
  getIndexConfig: function () {
    let res = data
    this.setData({
      imgUrls: res.data.banner,
      menus: res.data.menus,
      itemNew: res.data.roll,
      activityList: res.data.activity,
      bastBanner: res.data.info.bastBanner,
      bastInfo: res.data.info.bastInfo,
      bastList: res.data.info.bastList,
      fastInfo: res.data.info.fastInfo,
      fastList: res.data.info.fastList,
      firstInfo: res.data.info.firstInfo,
      firstList: res.data.info.firstList,
      salesInfo: res.data.info.salesInfo,
      likeInfo: res.data.likeInfo,
      lovelyBanner: res.data.lovely.length ? res.data.lovely[0] : {},
      benefit: res.data.benefit,
      logoUrl: res.data.logoUrl,
      couponList: res.data.couponList,
      newGoodsBananr: res.data.newGoodsBananr
    });
  },

  onLoad: function () {

  },
  onShow: function () {
    this.getIndexConfig();
  },

})